import { ResPage, ResultData, TestPaper } from "@/api/interface/index";
import http from "@/api";

/**
 * @name 试卷管理模块
 */
// 获取培训方案列表
export const getTestPaperList = (params: TestPaper.ReqTestPaperParams) => {
  return http.post<ResPage<TestPaper.ResTestPaperList>>(`/electcollect/trainExam/query`, params);
};
// 获取装置表号列表
export const getStationNoList = (params: TestPaper.ReqStationNoParams) => {
  return http.post<TestPaper.ResStationNoList>(`/electcollect/trainExam/stationNoQuery`, params);
};
// 新增培训方案
export const addTestPaper = (params = {}) => {
  return http.post(`/electcollect/trainExam/add`, params);
};
// 编辑培训方案
export const editTestPaper = (params: { examId: number }) => {
  return http.post(`/electcollect/trainExam/modify`, params);
};

// 删除培训方案
export const deleteTestPaper = (params: { examList: { examId: number }[] }) => {
  return http.post(`/electcollect/trainExam/remove`, params);
};

// 培训方案详情
export const getTestPaperDtl = (params: { examId: number }) => {
  return http.post<ResultData>(`/electcollect/trainExam/detail`, params);
};

// 试题选择列表
export const getQuestionSelList = (params = {}) => {
  return http.post(`/electcollect/trainExam/questionSelectionQuery`, params);
};

// 试卷选择列表
export const getExamSelList = (params = {}) => {
  return http.post(`/electcollect/trainExam/selectionQuery`, params);
};
